//
//  VisitorLoginView.swift
//  SinaWeibo23
//
//  Created by apple on 16/2/16.
//  Copyright © 2016年 apple. All rights reserved.
//

import UIKit
//需要导入命名空间
import SnapKit

class VisitorLoginView: UIView {

    //自定义访客视图
    //默认的构造方法
    override init(frame: CGRect) {
        //调用父类的构造方法
        super.init(frame: frame)
        setupUI()
    }
    
    
    private func setupUI() {
        addSubview(circleIcon)
        
        circleIcon.translatesAutoresizingMaskIntoConstraints = false
        
        circleIcon.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self.snp_centerX)
            make.centerY.equalTo(self.snp_centerY).offset(-60)
        }
        
    }
    
        required init?(coder aDecoder: NSCoder) {
        //系统默认在这个地方执行报错
        fatalError("init(coder:) has not been implemented")
//        super.init(coder: aDecoder)
    }
    
    
    private lazy var circleIcon: UIImageView = UIImageView(image: UIImage(named: "visitordiscover_feed_image_smallicon"))
    private lazy var largeHouse: UIImageView = UIImageView(image: UIImage(named: "visitordiscover_feed_image_house"))
    //提示用户登录的文案
    private lazy var tipLabel: UILabel = {
        let l = UILabel()
        l.text = "关注一些人,回这里看看有什么惊喜"
        l.font = UIFont.systemFontOfSize(14)
        l.textColor = UIColor.lightGrayColor()
        //自适应大小
        l.sizeToFit()
        
        return l
    }()
    
    //登录按钮
    private lazy var loginBtn: UIButton = {
       let btn = UIButton()
        //设置按钮
        btn.setTitle("登录", forState: .Normal)
        btn.setTitleColor(UIColor.darkGrayColor(), forState: .Normal)
        btn.setBackgroundImage(UIImage(named: "common_button_white_disable"), forState: .Normal)
        return btn
    }()
    
    //注册按钮
    private lazy var registerBtn: UIButton = {
        let btn = UIButton()
        //设置按钮
        btn.setTitle("注册", forState: .Normal)
        btn.setTitleColor(UIColor.orangeColor(), forState: .Normal)
        btn.setBackgroundImage(UIImage(named: "common_button_white_disable"), forState: .Normal)
        return btn
    }()
    
    
}
